export const schema = {
    title: "机构资料页",
    toolbar: {
        type: "button",
        actionType: "submit",
        label: "保存",
        icon: "fa fa-save pull-left",
        level: "primary",
        target: "theform"
    },
    body: {
        type: "form",
        name: "theform",
        mode: "horizontal",
        initApi: "get:/api/user/org",
        api: "post:/api/user/org",
        title: "",
        actions: [
            {
                type: "submit",
                primary: true,
                label: "保存",
                icon: "fa fa-save pull-left"
            }
        ],
        controls: [
            {
                type: "text",
                name: "name",
                label: "机构名称",
                required: true
            },

            {
                type: "divider"
            },

            {
                type: "image",
                name: "logo",
                label: "Logo",
                // accept: "image/png,image/jpeg",
                maxSize: 10 * 1024 * 1024,
                desc: '请选择 jpg 或者 png 图片，单个文件请不要超过 10M'
            },

            {
                type: "divider"
            },

            {
                type: "radios",
                name: "type",
                label: "机构类型",
                required: true,
                inline: true,
                source: "/api/setting/org_type?_=${_}"
            },

            {
                type: "divider"
            },

            [
                {
                    type: "text",
                    name: "contact_name",
                    label: "联系人",
                    required: true
                },

                {
                    type: "text",
                    name: "contact_phone",
                    label: "联系电话",
                    validations: 'isPhone',
                    required: true
                }
            ],

            {
                type: "divider"
            },

            {
                type: "text",
                name: "contact_email",
                validations: 'isEmail',
                label: "联系邮箱",
                required: true
            },

            {
                type: "divider"
            },

            {
                type: "region",
                name: "address",
                label: "联系地址",
                required: true
            },

            {
                type: "divider"
            },

            [
                {
                    type: "text",
                    name: "corporate_name",
                    label: "机构法人姓名",
                    required: true
                },

                {
                    type: "text",
                    name: "corporate_id",
                    label: "法人身份证号",
                    validations: 'isID',
                    required: true
                }
            ],

            {
                type: "divider"
            },

            {
                type: "text",
                name: "corporate_phone",
                validations: 'isPhone',
                label: "法人联系电话",
                required: true
            },

            {
                type: "divider"
            },

            {
                type: "image",
                name: "quality",
                label: "上传资质",
                // accept: "image/png,image/jpeg",
                maxSize: 10 * 1024 * 1024,
                desc: '上传资质文件做个说明，请选择 jpg 或者 png 图片，单个文件请不要超过 10M，最多可上传5张。',
                multiple: true,
                maxLength: 5
            },

            {
                type: "divider"
            },

            {
                type: "static",
                name: "username",
                label: "帐号"
            }
        ]
    }
};
